package Threaddemo.thread_0914;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class demo5_0914_0517 {
    public static void main(String[] args) {
        // ExecutorService 是一个接口，不能 new
        ExecutorService service = Executors.newCachedThreadPool();
        ExecutorService service1 = Executors.newFixedThreadPool(10);
        ExecutorService service2 = Executors.newSingleThreadExecutor();
        ExecutorService service3 = Executors.newScheduledThreadPool(10);
        service.submit( new Runnable() {
            @Override
            public void run() {
                System.out.println("线程池");
            }
        });
    }
}
